<?php
/**
 * Prado Portal.
 *
 * @author Steen Rabol <steen.rabol@gmail.com>
 * @link http://www.pradoportal.dk/
 * @copyright Copyright &copy; 2006,2007,2008 Steen Rabol
 * @license http://www.pradoportal.dk
 * @version $Id: SyndicatePortlet.php 465 2011-01-22 17:43:18Z steen.rabol $
 *
 */

Prado::using('Application.Portlets.Portlet');
Prado::using('Application.Common.Data.PortalConfigRecord');

class SyndicatePortlet extends Portlet
{
	protected function getConfigName()
	{
		return get_class() . '_' . $this->Parameters['id'];
	}

	public function onLoad($p)
	{
		parent::onLoad($p);
		if($this->ConfigRecord)
		{
			$v = Prado::unserialize($this->ConfigRecord->value);
			if(isset($v['syndicateurl']))
			{
				$this->SyndicateUrl->FrameUrl	= $v['syndicateurl'];
			}

			if(isset($v['width']))
			{
				$this->SyndicateUrl->Width	= $v['width'] . 'px';;
			}

			if(isset($v['height']))
			{
				$this->SyndicateUrl->Height	= $v['height'] . 'px';
			}

			if(isset($v['scrolling']))
			{
				if(TPropertyValue::ensureInteger($v['scrolling']) == 0)
				$this->SyndicateUrl->ScrollBars	= TInlineFrameScrollBars::Auto;
			}

			if(isset($v['border']))
			{
				$this->SyndicateUrl->ShowBorder	= $v['border'];
			}
		}
	}
}
?>